package com.metaverse.backend.repo;

import com.metaverse.backend.config.Constants;
import com.metaverse.backend.domain.SysConfig;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import springfox.documentation.annotations.Cacheable;

import java.util.Optional;

public interface SysConfigRepo extends JpaRepository<SysConfig, String>, JpaSpecificationExecutor<SysConfig> {


    /**
     * 统一缓存名称
     * @param name
     * @return
     */
    @Cacheable(Constants.SYS_CONFIG_CACHE)
    Optional<SysConfig> findByName(String name);
}